帝国CMS模板调用购物车商品数量和总价
$row = $result -> fetch_assoc();
echo $e->getMessage();
* 根据Cookie值对购物车商品数量和总价格调用
}
return $connect;
return "<div>您的购物车中有 {$totalProducts} 件商品,总计金额 ¥{$totalPrice}元。<br />点击查看 <a href='http://www.ym97.com/e/ShopSys/buycar/'>结算>></a> </div>";
}
//遍历商品
$connect -> query("set Names ".$phome_db_char);
?> function this_price($id){
$totalProducts += $thisNum; //购物车商品总数累加
throw new Exception("数据库链接不成功,请检查!");
$connect = connectDB();
}
$thisId = $thisId[1]; //当前商品的ID
throw new Exception("查询失败!");
}
$cookieString = explode("!",$_COOKIE['zeuqcmybuycar']);
return $row['price'];
function displayResultJs($totalPrice,$totalProducts){
$thisId = explode(",",$priceAndNumber[1]);
$thisPrice = this_price($thisId); //当前商品价格
require("class/connect.php");
global $phome_db_server,$phome_db_username,$phome_db_password,$phome_db_dbname,$phome_db_char;
$thisNum = $priceAndNumber[2]; //当前商品的数量
if(!$result = $connect -> query($query)){
function connectDB(){
echo "document.write("".displayResultJs($totalPrice,$totalProducts)."")"; //显示结果Js形式输出
// |77,243|2!|77,237|3!
}
$priceAndNumber = explode("|",$cookieString[$i]);
}
try{
$connect = new mysqli($phome_db_server,$phome_db_username,$phome_db_password,$phome_db_dbname);
}catch (Exception $e){
$totalPrice += $thisPrice * $thisNum; //购物车商品总价累加
for($i = 0; $i < count($cookieString)-1; $i++){
if(!$connect){
/**链接数据库*/
$totalProducts = 0; //购物车商品总数
*/
/**显示结果Js*/
/**
/**计算商品价格*/
}
$query = "select price from phome_ecms_news where id = ".$id;
$totalPrice = 0.0;
//购物车商品总价
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jz/ecms/1825.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
帝国ecms列表页标题图片判
时间:2020-12-26
-
帝国cms模板怎么在BGK和U
时间:2020-12-25
-
帝国cms会员前台怎么关闭
时间:2020-12-25
-
帝国CMS7.0碎片功能升级后
时间:2020-12-25
-
帝国cms怎么修改软件下载
时间:2020-12-25
-
帝国CMS 6.0功能解密之会员
时间:2020-12-15
-
帝国cms如何导出模板
时间:2020-12-14
-
帝国CMS 6.0功能解密之评论
时间:2020-12-13
热门文章
-
帝国CMS7.0新增将信息处理结果反馈给会员
时间:2020-12-10
-
帝国CMS7.0专题大更新,功能更强大,制作
时间:2020-12-10
-
修改帝国CMS模板出现Application Firewall Ale
时间:2020-12-08
-
帝国CMS7.0新增外部登录接口平台,且将率
时间:2020-12-10
-
帝国6.6版本新增信息快速修改基本属性功
时间:2020-12-11
-
帝国CMS7.2新增批量更新信息评论数功能,
时间:2020-12-09
-
帝国cms6.6版本新增专题属性自定义字段功
时间:2020-12-12
-
帝国CMS7.5的信息头条和推荐各支持255级更
时间:2020-12-08
-
帝国cms的信息反馈增加反馈编号加回复功
时间:2020-12-12
-
帝国CMS用户自定义函数取昨天发表的文章
时间:2020-12-09
